//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//

package com.example.mapper;

import com.example.entity.Article;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface ArticleMapper {
    List<Article> selectAll(Article article);

    @Select({"select * from article where id = #{id}"})
    Article selectById(Integer id);

    @Insert({"insert into article (title,img,descr,content,time) values (#{title},#{img},#{descr},#{content},#{time})"})
    int insert(Article article);

    @Update({"update article set title = #{title}, img = #{img},descr = #{descr},content = #{content},time = #{time} where id=#{id}"})
    int updateById(Article article);

    @Delete({"delete from article where id = #{id}"})
    int deleteById(Integer id);

}
